package task;

import java.util.Scanner;

public class Task4_7 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        addFactorial(n);
    }

    public static void addFactorial(int n){
        int result = 0;
        int sum = 1;
        for (int i = 1; i <= n ; i++) {
            sum = sum * i;
            result += sum;
        }
        System.out.println(result);
    }
}
